//配置并创建route
import Vue from 'vue'
import Router from "vue-router";

Vue.use(Router)

//引入route
import Department from "@/components/Department";
import Login from "@/components/Login";
import home from "@/components/home";
import Fmeditem from "@/components/Fmeditem";

//router是管理路由的
const router = new Router(
    {
        routes:[
            {
                path:'/login',
                component:Login
            },
            {
                path: '/home',
                component: home,
                children:[//配置子路由
                    {
                        path: '/dept',
                        component: Department
                    },
                    {
                        path: '/fmed',
                        component: Fmeditem
                    }
                ]
            },{
                //添加默认路由
                path: '',
                redirect:'/login'
            }
        ]
    }
)

//导出路由
export default router;